package lab01;

/**
 * Created by 李震豪 on 2017/10/8.
 */
public class Test05 {
    public static void main(String[] args) {
        /*int n=100;
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            sum += i;
        }
        System.out.println(sum);
        int n=100;
        int sum=0;
        int i=0;
        while (i<=n){
            sum+=i++;
        }
        System.out.println(sum);*/
        int n=100;
        int sum=0;
        int i=0;
        do{
            sum+=i++;
        }
        while(i<=n);
        System.out.println(sum);




    }
}

